package leetcode;

import java.util.Arrays;

public class LeetCodeMain112 {
    public String minNumber(int[] nums) {
        if (nums==null||nums.length==0){
            return "";
        }
        int length=nums.length;
        String[] str=new String[length];
        for (int i = 0; i < length; i++) {
            str[i]=String.valueOf(nums[i]);
        }
        Arrays.sort(str,(o1, o2) -> (o1+o2).compareTo(o2+o1));
        StringBuffer buffer=new StringBuffer();
        for (String s:str) {
            buffer.append(s);
        }
        return buffer.toString();
    }
}
